package com.example.votemanage.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.votemanage.entity.VoteOption;
import com.example.votemanage.entity.VoteUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface VoteUserMapper extends BaseMapper<VoteUser> {
    // 使用 @Param 注解来指定参数名，这样 MyBatis-Plus 就能正确地将参数绑定到 SQL 语句中
    @Select("select * from vote_user where VU_USER_ID = #{userid} and VU_PASSWORD = #{password}")
    VoteUser selectByNameAndPassword(@Param("userid") String userid, @Param("password") String password);
    @Select("select * from vote_user where VU_USER_ID = #{userid}")
    List<VoteUser> selectByUsId(String userid);
}